<?php $this->renderPartial('_form_add_block', array('model' => $model)); ?>
<div class='left'>
    <div class="wrap-page">
	<div class="title-page"><strong>Message</strong></div>   
	<div class="content-page">
	    <?php $this->renderPartial('_menu'); ?>
	    <div class="mailbox-message-list list-block-user">     
		<a class="show-form-post btn" href="#add-blocked-to-list"><i class="icon-plus"></i> Add to blocked list</a>
		<?php
		$this->widget('bootstrap.widgets.TbGridView', array(
		    'id' => 'post-grid',
		    'dataProvider' => $model->search(user()->id),
		    'filter' => $model,
		    'columns' => array(
			array(
			    'header' => 'Avatar',
			    'type' => 'raw',
			    'value' => function($data) {
				return '<img src="' . $data->blockedUser->getAvatarUrl('small') . '"/>';
			    },
			    'filter' => false
			),
			array(
			    'header' => 'Email',
			    'name' => 'email',
			    'type' => 'raw',
			    'value' => function($data) {
				return $data->blockedUser->getEmail();
			    }
			),
			array(
			    'header' => 'Blocked Time',
			    'name' => 'time_created',
			    'type' => 'raw',
			    'value' => function($data) {
				return date('m-d-Y', strtotime($data->time_created));
			    },
			    'filter' => FALSE
			),
			array(
			    'class' => 'bootstrap.widgets.TbButtonColumn',
			    'template' => '{delete}',
			    'buttons' => array(
				'delete' => array(
				    'url' => 'Yii::app()->controller->createUrl("message/delete_block_user", array("id"=>$data->block_message_id, "id_user" =>$data->user_block))',
				)
			    ),
			)
		    ),
		));
		?>
	    </div>
	</div>
    </div>
</div>
<div class="right">
    <div class="box-right">
	<?php $this->widget('application.widgets.loginbox.LoginBox'); ?>

    </div><!--box-right-->
    <?php $this->widget('application.widgets.ad.Ad') ?>
</div><!--right-->



